<template>
    <section>
        <sy-baselist
                ref="outstock"
                editVue="./business/Outstock_Edit.vue"
                :filters="filters"
                listUrl="server/business/StonehouseFlow.ashx?cmd=GetList"
                fixWhere="FType=2"
                deleteUrl="server/business/StonehouseFlow.ashx?cmd=Delete"
                @onLoadRow="onLoadRow"
        >
            <el-table-column prop="StonehouseName" label="仓库名称" width="150">
            </el-table-column>
            <el-table-column prop="FAddTime"  header-align="center" label="出库时间"  width="180" >
            </el-table-column>
            <el-table-column prop="UserName" align="center"  header-align="center" label="操作人"  width="180" >
            </el-table-column>
            <el-table-column prop="StatusName" label="状态" width="100">
            </el-table-column>
            <template  scope="props" slot="extendbtn">
                <el-button size="small" v-if="props.row.FStatus==0"  style="margin-left: 0px;" @click="OutstockSure(props.row)">确认</el-button>
            </template>
        </sy-baselist>

    </section>
</template>

<script>
    import util from '../../common/util'
    export default {
        data(){
            return {
                filters: [{type: "date",name:"FAddTime",text:"出库时间", value: null}]
            }
        },
        methods:{
            onLoadRow(row)
            {
                row.FAddTime = util.date.format(row.FAddTime,'yyyy-MM-dd hh:mm:ss')
                row.StatusName = row.FStatus==0?'未提交':'已提交'
                if(row.FStatus!=0){
                    row.hideDeleteBtn=true;
                    row.editTitle = '查看'
                }
            },
            OutstockSure(row){
                util.post("server/business/StonehouseFlow.ashx?cmd=Sure",row,this.switchLoading,result=> {
                    util.msgSuc("确认成功")
                    this.$refs.outstock._refrash()
                })
            }
        },
        created(){

        }
    }
</script>